$(function(){
	
	//查询物流消息列表
	newsDtoList();
});
/**
 * @title   查询物流消息列表
 * @param   type:  消息类别0：交易物流信息，1：通知消息，2：我的问答 3：商品咨询
 * @return  type;  //消息类别
 * @return  typeTitle; //消息类别描述
 * @return  newsTitle;  //消息状态描述
 * @return  hotNew;  //最新消息动态
 * @return  memberId; //会员用户id
 * @return  latestTime; //消息最新时间
 * @return  latestOrderGgoodsName; //消息订单中第一个商品名称	
 * @return  latestOrderGoodsImgUrl; //消息订单中第一个商品的图片文件路径列表
 * @return  latestOrderGoodsPicture; //消息订单中第一个商品的默认图片路径
 * @return  orderId; //订单编号 
 * @date    2017-06-15
 * @author  LeiJia
 */
function newsDtoList(){
	var mId = member.mId;
	var url = rootPath + "/member/newsDtoList";
	var result = CommnUtil.ajax(url,{"mId":mId,"type": "0"},"json");
	//debugger;
	if(result.resultSuccess){
		var data = result.data;
		if(CommnUtil.notNull(data)){
			var html="";
			$.each(data,function(i,news){
				html+=wuLiuNews(news);			
			});

			$("div").append(html);
		}else{
			$("div").html('<p class="question questionO"  style="width: 97.67%;">无物流消息</p>');
		}
	}else{
		alert("查询消息中心消息类别错误!");
	}
}
function wuLiuNews(news){
	var latestOrderGgoodsName = news.latestOrderGgoodsName;
	var informationUrl = rootPath +'/member/information?expressName='+news.expressName+'&expressCode=' + news.expressCode+'&orderId='+news.orderId+'&newsTitle=' +news.newsTitle;
	//var expressUrl ='https://m.kuaidi100.com/index_all.html?type='+news.expressName+'&postid=' + news.expressCode;
	var $p = '<p class="question questionO">'+news.latestTime+'</p>';	
	var $myQuestions = '<div class="myQuestions clearfix">'
						    +		'<a href="'+informationUrl+'">'
						//	+		'<a href="'+expressUrl+'">'
							+	'<p>'+news.newsTitle+'</p>'
							+	'<img src="'+news.latestOrderGoodsPicture+'" alt="'+news.latestOrderGgoodsName+'" class="fl"/>'
							+	'<p class="fr">'
							+		'<span class="moreWord">'+latestOrderGgoodsName.substr(0,64)+'...</span>'
							+	   ' <span>订单编号：'+news.orderId+'</span>'
							+	'</p>'
							+'</a>'
						+'</div>';
	return $p+$myQuestions;
	
}